#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    : 2023/12/01 0:05
# @function: the script is used to do something.
# @version : 

import requests
from requests.utils import dict_from_cookiejar

url = "http://www.baidu.com"
# 发送请求，获取response
response = requests.get(url)
print(type(response.cookies))
# 使用dict_from_cookiejar函数将response.cookies转换成字典形式
cookie = dict_from_cookiejar(response.cookies)
print(cookie)
# 建议使用下面这个
print(requests.utils.dict_from_cookiejar(response.cookies))
